package com.spring.gop.proj.dao;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.spring.gop.proj.dao.mapper.MovieMapper;
import com.spring.gop.proj.interfaces.MovieDao;
import com.spring.gop.proj.model.Buy;
import com.spring.gop.proj.model.Movie;
import com.spring.gop.proj.model.MovieAttach;
import com.spring.gop.proj.model.MovieChart;

@Repository
public class MovieDaoImpl implements MovieDao {
	
	@Autowired MovieMapper movieMapper;

	public List<Movie> selectMovies() {
		return movieMapper.selectMovies();
	}
	
	public List<Movie> selectMovieForTitle(String searchMovieName) {
		return movieMapper.selectMovieForTitle(searchMovieName);
	}
	
	public Movie selectMovie(int num) {
		return movieMapper.selectMovie(num);
	}
	
	public List<MovieAttach> selectMovieAttach(int num) {
		return movieMapper.selectMovieAttach(num);
	}
	
	public List<MovieAttach> selectMovieBanner() {
		return movieMapper.selectMovieBanner();
	}
	
	public List<MovieChart> selectMovieChart(int regyear, int regmonth) {
		return movieMapper.selectMovieChart(regyear, regmonth);
	}
	
	public Buy selectBuyMovieForId(Map<String, Object> map) {
		return movieMapper.selectBuyMovieForId(map);
	}
	
	public List<Buy> selectBuyListMovieForId(String member_id) {
		return movieMapper.selectBuyListMovieForId(member_id);
	}
	
	public void insertBuyMovie(Buy buy) {
		movieMapper.insertBuyMovie(buy);
	}
}
